package com.wuxiaofan.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.order.entity.OrderOperateHistory;
import com.wuxiaofan.order.entity.custom.OrderOperateHistoryCustom;
import com.wuxiaofan.order.mapper.OrderOperateHistoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.order.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class OrderOperateHistoryService {
    @Autowired
    private OrderOperateHistoryMapper omsOrderOperateHistoryMapper;
    @Resource
    private Idgenerator idgenerator;
    public OrderOperateHistory findById(String id){
        return omsOrderOperateHistoryMapper.selectById(id);
    }

    public OrderOperateHistoryCustom findCountByMap(Map paraMap){
        return omsOrderOperateHistoryMapper.findCountByMap(paraMap);
    }

    public OrderOperateHistoryCustom findGroupByMap(Map paraMap){
        return omsOrderOperateHistoryMapper.findGroupByMap(paraMap);
    }

    public List<OrderOperateHistoryCustom> findByMap(Map paraMap){
        return omsOrderOperateHistoryMapper.findByMap(paraMap);
    }

    public Page<OrderOperateHistoryCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(omsOrderOperateHistoryMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        omsOrderOperateHistoryMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        omsOrderOperateHistoryMapper.deleteById(id);
    }

    public OrderOperateHistory save(OrderOperateHistory omsOrderOperateHistory){
        omsOrderOperateHistory.setId(idgenerator.getId());
        omsOrderOperateHistoryMapper.insert(omsOrderOperateHistory);
        return omsOrderOperateHistory;
    }

}
